package com.xm;

class Student {

    private String name;
    private int age;
    private String sex;

    // 定义构造方法
    public Student(String name2, int age, String sex) {
        name = name2;
        System.out.println("name = " + name);
        // age = age;
        System.out.println("age = " + age);
        this.sex = sex;
        System.out.println("sex = " + sex);
    }

    public String reade() {
        return "我是:" + name + ",年龄：" + age + ",性别：" + sex;

    }
}

public class ThisDemo {
    public static void main(String[] args) {
        Student stu = new Student("张三", 18, "男");
        System.out.println(stu.reade());
    }
}
